<!--// 스킨 css 로드 -->
<!--%import("stylesheets/xq_ui.css")-->
<!--%import("stylesheets/default.css")-->
<script type="text/javascript">
    var editor_path = "{$editor_path}";
</script>

<!--// 기본 js/언어파일 로드 -->
<!--%import("../../tpl/js/editor_common.js")-->
<!--%import("javascripts/module/Full_merged_min.js",optimized=false)-->
<!--%import("javascripts/xe_interface.js",optimized=false)-->

<!-- 자동저장용 폼 -->
<!--@if($enable_autosave)-->
<input type="hidden" name="_saved_doc_srl" value="{$saved_doc->document_srl}" />
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
<!--@end-->

<!-- 에디터 -->
<div class="xeEditor" style="margin-top:5px; margin-bottom:5px;">
        <!--@if($enable_component)-->
        <!-- 확장 컴포넌트 출력 -->
        <div class="optionDE">
            <div class="optionE">
                <div class="buttonGroup" id="editor_component_{$editor_sequence}">
                <!--@foreach($component_list as $component_name => $component)-->
                    <!--@if(substr($component_name,0,11)!="colorpicker")-->
                        <img src="../../components/{$component_name}/icon.gif" alt="{$component->title}" title="{$component->title}" id="component_{$editor_sequence}_{$component_name}" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
                    <!--@end-->
                <!--@end-->
                </div>
            </div>
        </div>
        <!--@end-->

    <!-- HTML 모드 사용 기능 및 자동저장 메세지 출력용 -->
    <div class="editor_info">
        <div class="editor_autosaved_message" id="editor_autosaved_message_{$editor_sequence}">&nbsp;</div>
    </div>

    <!-- 에디터 출력 -->
    <textarea id="xqEditor_{$editor_sequence}"></textarea>
    <textarea id="editor_textarea_{$editor_sequence}" class="editor_iframe_textarea" style="display:none; height:{$editor_height}"  rows="10" cols="10"></textarea>

    <!-- 에디터 크기 조절 bar -->
    <div class="textAreaDragIndicator"><div class="textAreaDragIndicatorBar" id="editor_drag_bar_{$editor_sequence}"></div></div>

<!--@if($allow_fileupload)-->
    <!--%import("../../tpl/js/uploader.js",optimized=false)-->
    <!--%import("../../tpl/js/swfupload.js",optimized=false)-->
    <script type="text/javascript">//<![CDATA[
        editorUploadInit(
            {
                "editorSequence" : {$editor_sequence},
                "sessionName" : "{session_name()}",
                "allowedFileSize" : "{$file_config->allowed_filesize}",
                "allowedFileTypes" : "{$file_config->allowed_filetypes}",
                "allowedFileTypesDescription" : "{$file_config->allowed_filetypes}",
                "insertedFiles" : {(int)$files_count},
                "replaceButtonID" : "swfUploadButton{$editor_sequence}",
                "fileListAreaID" : "uploaded_file_list_{$editor_sequence}",
                "previewAreaID" : "preview_uploaded_{$editor_sequence}",
                "uploaderStatusID" : "uploader_status_{$editor_sequence}"
            }
        );
    //]]></script>

    <table cellspacing="0" class="fileAttach">
    <col width="120" />
    <col width="100%" />
    <tr valign="top">
        <td width="120"><div class="preview" id="preview_uploaded_{$editor_sequence}"><img src="./images/blank.gif" alt="preview" width="100" height="100" /></div></td>
        <td>
            <!-- 파일 업로드 영역 -->
            <div class="fileListArea">
                <select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" size="5" class="fileList"></select>
            </div>
            <div class="fileUploadControl">
                <span id="swfUploadButton{$editor_sequence}" style="display : block; float:left;"><span class="button"><button type="button">{$lang->edit->upload_file}</button></span></span>
                <a href="#" onclick="removeUploadedFile('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->delete_selected}</span></a>
                <a href="#" onclick="insertUploadedFile('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->link_file}</span></a>
            </div>
            <div class="file_attach_info" id="uploader_status_{$editor_sequence}">{$upload_status}</div>
        </td>
    </tr>
    </table>
<!--@end-->
</div>


<!-- 에디터 활성화 -->
<script type="text/javascript">//<![CDATA[
    var auto_saved_msg = "{$lang->msg_auto_saved}";
    var xed_{$editor_sequence};
    var load_{$editor_sequence} = function() {
        setEditMode(xed_{$editor_sequence}, "{$editor_height}px", {$editor_sequence});
    };

	if(document.getElementById("comment_{$editor_sequence}") == null || document.getElementById("comment_{$editor_sequence}").style.display != 'none') { 
        xed_{$editor_sequence} = editorStart_xq(xed_{$editor_sequence}, document.getElementById("xqEditor_{$editor_sequence}"), {$editor_sequence}, "{$editor_content_key_name}", "{$editor_height}px", "{$editor_primary_key_name}");
        xAddEventListener(window, 'load', load_{$editor_sequence}); 
	}
//]]></script>

